package com.mmall.util;

import com.mmall.pojo.User;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by root on 18-5-5.
 */
public class SessionUtil {




    public static User getCurrentUser(HttpServletRequest request) {
        String sessionId = CookieUitl.readSessionId(request);
        if (sessionId != null) {
            String userStr = RedisShardedPoolUtil.get(sessionId);
            return JasonUtil.str2Object(userStr, User.class);
        }
        return null;
    }
}
